package ${packageName}.mvp.ui;

import android.net.Uri;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.callback.NavCallback;
import com.alibaba.android.arouter.launcher.ARouter;
import com.jpxx.base.ui.mvp.base.IBaseActivity;
import com.jpxx.base.ui.mvp.di.component.AppComponent;

import androidx.annotation.NonNull;

/**
 * Created by Mikes at 2019/4/28 9:22 AM
 * APP DeepLink跳转，依赖ARouter，解耦。
 */
public class UrlSchemeFilterActivity extends IBaseActivity {
    @Override
    public void setupActivityComponent(@NonNull AppComponent appComponent) {
        //null presenter
    }

    @Override
    public int getLayoutResourceId() {
        return 0;
    }

    @Override
    public void initView() {
        Uri schemeUri = getIntent().getData();
        if(schemeUri != null){
            ARouter.getInstance().build(schemeUri).navigation(this, new NavCallback() {
                @Override
                public void onArrival(Postcard postcard) {
                    UrlSchemeFilterActivity.this.finish();
                }
            });
        } else{
            this.finish();
        }
    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {

    }
}
